<?php

namespace App\Http\Requests\Api\Admin;

use App\Http\Requests\Api\FormRequest;

class CaptchaRequest extends FormRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'phone' => ['nullable', 'regex:/^1[3456789]\d{9}$/']
        ];
    }

    public function messages()
    {
        return [
            'phone.regex' => '手机号码格式错误'
        ];
    }

}
